baseline <- DSMhabitat::sr_spawn$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::sr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::sr_spawn$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::sr_spawn$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::sr_spawn$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
spawn <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1979:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 8,184
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 197…
## $ baseline <dbl> 63.4561418, 15.2083236, 1.2560637, 0.0000000, 15.2704170,…
## $ run_of_river <dbl> 61.6312704, 15.1219018, 1.2479549, 0.0000000, 15.3256482,…
## $ tmh <dbl> 508.574200, 14.895208, 17.315846, 0.000000, 13.340559, 71…
## $ ror_tmh <dbl> 522.197703, 14.810565, 15.070820, 0.000000, 13.388810, 60…
spawn %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass', "Upper-mid Sacramento River", "Lower-mid Sacramento River", "Lower Sacramento River", "San Joaquin River"))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()
baseline <- DSMhabitat::sr_fry$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::sr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::sr_fry$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::sr_fry$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::sr_fry$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
fry <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 29.6070100, 28.4613903, 10.8842946, 16.4905863, 13.440343…
## $ run_of_river <dbl> 32.8966257, 28.1553568, 10.8842946, 16.4132850, 13.349777…
## $ tmh <dbl> 1616.47299, 42.03513, 92.36974, 31.65986, 49.65558, 42.18…
## $ ror_tmh <dbl> 1517.799571, 38.007684, 92.369739, 31.511451, 49.206592, …
fry %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line() +
facet_wrap(~watershed, scales = 'free_y')
baseline <- DSMhabitat::sr_juv$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::sr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::sr_juv$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::sr_juv$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::sr_juv$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
juv <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 29.6070100, 25.0079447, 20.2739580, 16.5835547, 11.503870…
## $ run_of_river <dbl> 32.8966257, 23.8900193, 20.2739580, 16.3056130, 11.163933…
## $ tmh <dbl> 1616.47299, 32.68638, 92.36974, 37.59226, 44.89494, 20.67…
## $ ror_tmh <dbl> 1517.799571, 31.912876, 92.369739, 36.962213, 43.706265, …
juv %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line() +
facet_wrap(~watershed, scales = 'free_y')
baseline <- DSMhabitat::sr_fp$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::sr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::sr_fp$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::sr_fp$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::sr_fp$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
fp <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 5.360953, 10.595803, 0.000000, 3.324882, 0.000000, 43.659…
## $ run_of_river <dbl> 20.442699, 14.216084, 0.000000, 3.573687, 0.000000, 46.75…
## $ tmh <dbl> 1327.338858, 320.674084, 0.000000, 3.324882, 0.000000, 33…
## $ ror_tmh <dbl> 1101.823957, 135.096948, 0.000000, 3.573687, 0.000000, 34…
fp %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
filter(watershed == "Lower-mid Sacramento River") |>
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()
Something funky going on with Lower-mid sac fp habitat
sit_habitat <- DSMhabitat::delta_habitat$sit_habitat[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
baseline <- DSMhabitat::delta_habitat$r_to_r_baseline[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::delta_habitat$max_flow_w_hab_projects[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::delta_habitat$r_to_r_tmh[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::delta_habitat$run_of_river_tmh[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
delta <- expand_grid(
watershed = c("North Delta"),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
sit_habitat = as.vector(sit_habitat),
baseline = as.vector(baseline),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 252
## Columns: 8
## $ watershed <chr> "North Delta", "North Delta", "North Delta", "North Delta…
## $ month <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ sit_habitat <dbl> 4796.375, 3648.276, 5023.072, 4826.862, 2594.710, 4486.45…
## $ baseline <dbl> 9308.159, 7080.082, 9748.101, 9367.324, 5035.463, 8706.70…
## $ run_of_river <dbl> 9308.159, 7080.082, 9748.101, 9367.324, 5035.463, 8706.70…
## $ tmh <dbl> 37421.05, 28463.64, 39189.73, 37658.91, 20243.78, 35003.0…
## $ ror_tmh <dbl> 37421.05, 28463.64, 39189.73, 37658.91, 20243.78, 35003.0…
delta %>%
transmute(watershed, date = ymd(paste(year, month, 1)), sit_habitat, baseline, run_of_river, tmh, ror_tmh) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version, linetype = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()